//
//  UIView+Response.m
//  weike
//
//  Created by apple on 15-5-8.
//  Copyright (c) 2015年 hu. All rights reserved.
//

#import "UIView+Response.h"
#import "NSString+URLEncoding.h"


@implementation UIView (UIViewResponse)


-(UIViewController *)responderController
{
    UIResponder *nextR = [self nextResponder];
    do {
        if([nextR isKindOfClass:NSClassFromString(@"UIViewController")]){
            return (UIViewController *)nextR;
            
        }else{
            nextR = [nextR nextResponder];
        }
    }while (nextR!=nil);
    
    return nil;
}

-(UINavigationController *)responderNavigationController
{
    UIResponder *nextR = [self nextResponder];
    do {
        if([nextR isKindOfClass:NSClassFromString(@"UINavigationController")]){
            return (UINavigationController *)nextR;
            
        }else{
            nextR = [nextR nextResponder];
        }
    }while (nextR!=nil);
    
    return nil;
}

@end
